<?php
// 本类由系统自动生成，仅供测试用途
class IndexAction extends Action {

    public function index(){
		Load('extend');
		$Product =   M('Product');
		//焦点图5条新闻
		$IndexArr = $Product->query("SELECT `v9_product`.*,v9_product.thumb as newsthumb,v9_position_data.* FROM `v9_product` 
left join `v9_position_data` on  `v9_product`.id=`v9_position_data`.id  WHERE v9_product.title!='' AND v9_product.thumb!='' AND v9_position_data.posid =1 order by `v9_product`.id desc limit 0,5");

		//3条头部新闻
		$HeadArr = $Product->query("SELECT `v9_product`.*,v9_product.thumb as newsthumb,v9_position_data.* FROM `v9_product` 
left join `v9_position_data` on  `v9_product`.id=`v9_position_data`.id  WHERE  v9_product.title!='' AND v9_position_data.posid =2 order by `v9_product`.id desc limit 0,3");
		
	
		//头部中间的8条新闻
		/*$HeadCenterArr = $Product->query("SELECT `v9_product`.*,v9_product.thumb as newsthumb,v9_position_data.* FROM `v9_product` 
left join `v9_position_data` on  `v9_product`.id=`v9_position_data`.id  WHERE  v9_product.title!='' AND v9_position_data.posid =2 order by `v9_product`.id desc limit 0,5");*/
		
		//新闻快报
		$HeadImgListArr = $Product->query("SELECT `v9_product`.*,v9_product.thumb as newsthumb FROM `v9_product`  WHERE v9_product.title!='' AND v9_product.thumb!='' order by `v9_product`.id desc limit 0,4");

		//$IndexKuaiArr = array_slice($HeadImgListArr,0,1);
		
		//热点图片
		//$NewTopArr = $Product->query("SELECT `v9_product`.*,v9_product.thumb as newsthumb FROM `v9_product`  WHERE v9_product.title!='' AND v9_product.thumb!='' order by `v9_product`.id desc limit 4,6");

		$NewTopArr = array_slice($HeadImgListArr,0,4);


		//地板产品
		$DibanListArr = $Product->query("SELECT `v9_product`.*,v9_product.thumb as newsthumb FROM `v9_product`  WHERE v9_product.catid IN (14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33) AND v9_product.title!=''  order by `v9_product`.id desc limit 0,10");
	
		
		//灯具产品
		$DengjuListArr = $Product->query("SELECT `v9_product`.*,v9_product.thumb as newsthumb FROM `v9_product`  WHERE v9_product.catid IN (68,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216) AND v9_product.title!=''  order by `v9_product`.id desc limit 0,10");

		//家具产品
		$JiajuListArr = $Product->query("SELECT `v9_product`.*,v9_product.thumb as newsthumb FROM `v9_product`  WHERE v9_product.catid IN (69,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231) AND v9_product.title!='' order by `v9_product`.id desc limit 0,10");
		

		//卫浴产品
		$WeiyuListArr = $Product->query("SELECT `v9_product`.*,v9_product.thumb as newsthumb FROM `v9_product`  WHERE v9_product.catid IN (34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65) AND v9_product.title!=''  order by `v9_product`.id desc  limit 0,10");
		

		//门窗产品
		$MenchuangListArr = $Product->query("SELECT `v9_product`.*,v9_product.thumb as newsthumb FROM `v9_product`  WHERE v9_product.catid IN (67,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175) AND v9_product.title!=''  order by `v9_product`.id desc  limit 0,15");

		//厨具产品
		$ChujuListArr = $Product->query("SELECT `v9_product`.*,v9_product.thumb as newsthumb FROM `v9_product`  WHERE v9_product.catid IN (76,334,335,336,337,338,339,340,341,342,343,344,345,346) AND v9_product.title!=''  order by `v9_product`.id desc  limit 0,15");

		//$KejiListArr = array_slice($KejiNewsListArr,0,12);


		$this->assign('IndexArr',$IndexArr);
		$this->assign('IndexKuaiArr',$IndexKuaiArr);
		$this->assign('HeadArr',$HeadArr);
		$this->assign('HeadCenterArr',$HeadCenterArr);
		$this->assign('HeadArr',$HeadArr);
		$this->assign('NewTopArr',$NewTopArr);


		$this->assign('DibanListArr',$DibanListArr);
		$this->assign('DengjuListArr',$DengjuListArr);
		$this->assign('JiajuListArr',$JiajuListArr);
		$this->assign('WeiyuListArr',$WeiyuListArr);
		$this->assign('MenchuangListArr',$MenchuangListArr);
		$this->assign('ChujuListArr',$ChujuListArr);

		$keys = explode(',',$seo_Arr);
		$SEO['title'] = '都市家建材网-中国最全的建材种类行业门户网站';
		$SEO['keywords'] = '都市家建材网,建材网,建材网站,建材产品供应,建材产品采购,建材产品招商,建材产品加盟';
		$SEO['description'] = '都市家建材网提供专业且全面的建材产品供求信息,主要信息包含:建材产品的报价,建材产品的品牌,建材产品的招商，加盟以及建材代理信息,为广大建材行业的个人与企业同行们，提供海量的建材信息与商机，努力打造成中国最全的建材种类行业门户网站.';
		$this->assign('SEO',$SEO);// SEO相关

		$this->display(); // 输出模板

    }

	 public function show(){
		echo '@@@@';exit;
	 }



}